import 'package:flutter_uikit/pages/running_water/running_water_view.dart';
import 'package:get/get.dart';
import 'bottom_sheet/bottom_sheet_view.dart';
import 'chart/chart_view.dart';
import 'general_dialog/general_dialog_view.dart';
import 'image/image_view.dart';
import 'list_view/list_view_view.dart';
import 'root_state.dart';
import 'tab_bar/tab_bar_view.dart';

class RootLogic extends GetxController {
  final RootState state = RootState();

  @override
  void onInit() {
    super.onInit();
  }

  /// item点击事件
  void itemEvent(String title) {
    if (title == "BottomSheet") {
      Get.to(() => const BottomSheetPage(), arguments: {"title": title});
    } else if (title == "Dialog") {
      Get.to(() => const GeneralDialogPage(), arguments: {"title": title});
    } else if (title == "ListView") {
      Get.to(() => const ListViewPage(), arguments: {"title": title});
    } else if (title == "Image") {
      Get.to(() => const ImagePage(), arguments: {"title": title});
    } else if (title == "Chart") {
      Get.to(() => const ChartPage(), arguments: {"title": title});
    } else if (title == "TabBar") {
      Get.to(() => const TabBarPage(), arguments: {"title": title});
    } else if (title == "RunningWater") {
      Get.to(() => const RunningWaterPage());
    }
  }
}
